<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="docker,zookeeper,storm,mesos,dcos,marathon,drpc," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="在DC/OS中部署Storm集群环境，主要是指部署Storm的 Nimbus、UI和DRPC服务。Storm的Supervisor/Worker服务是在向Storm集群部署拓扑（Topology）时，由Mesos自动分配资源调度执行。">
<meta property="og:type" content="article">
<meta property="og:title" content="Storm on DC/OS(3) - 集群部署">
<meta property="og:url" content="http://chrisrc.me/2016/12/05/storm-on-dcos-3/index.html">
<meta property="og:site_name" content="山中，山外与俯瞰">
<meta property="og:description" content="在DC/OS中部署Storm集群环境，主要是指部署Storm的 Nimbus、UI和DRPC服务。Storm的Supervisor/Worker服务是在向Storm集群部署拓扑（Topology）时，由Mesos自动分配资源调度执行。">
<meta property="og:updated_time" content="2016-12-17T09:59:56.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Storm on DC/OS(3) - 集群部署">
<meta name="twitter:description" content="在DC/OS中部署Storm集群环境，主要是指部署Storm的 Nimbus、UI和DRPC服务。Storm的Supervisor/Worker服务是在向Storm集群部署拓扑（Topology）时，由Mesos自动分配资源调度执行。">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://chrisrc.me/2016/12/05/storm-on-dcos-3/"/>





  <title> Storm on DC/OS(3) - 集群部署 | 山中，山外与俯瞰 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">山中，山外与俯瞰</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">一次永不停止的探索之旅</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-dcos">
          <a href="/dcos" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            DC/OS
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'R9GcmhBwxpsAGLNCsquZ','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://chrisrc.me/2016/12/05/storm-on-dcos-3/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="chrisrc">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="山中，山外与俯瞰">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="山中，山外与俯瞰" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Storm on DC/OS(3) - 集群部署
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2016-12-05T17:10:18+08:00">
                2016-12-05
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/DC-OS/" itemprop="url" rel="index">
                    <span itemprop="name">DC/OS</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <a href="/2016/12/05/storm-on-dcos-3/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2016/12/05/storm-on-dcos-3/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>在DC/OS中部署Storm集群环境，主要是指部署Storm的 <strong>Nimbus</strong>、<strong>UI</strong>和<strong>DRPC</strong>服务。Storm的Supervisor/Worker服务是在向Storm集群部署拓扑（Topology）时，由Mesos自动分配资源调度执行。<br><a id="more"></a></p>
<h2 id="Nimbus部署"><a href="#Nimbus部署" class="headerlink" title="Nimbus部署"></a>Nimbus部署</h2><p>在本实现的镜像中，通过Marathon部署Nimbus时，Storm的UI服务可以在启动Nimbus时默认同时启动。</p>
<p>根据前述Storm集群配置所述，即使在<code>storm.yaml</code>中配置了不同于<code>mesos.master.url</code>的<code>storm.zookeeper.servers</code>配置，服务启动时默认仍使用<code>mesos.master.url</code>中配置的ZK集群信息，因此，在DC/OS中部署Storm集群时，根据是否使用DC/OS默认ZK集群，Marathon的应用配置稍有差别。</p>
<h3 id="使用DC-OS的Exhibitor-ZK-服务"><a href="#使用DC-OS的Exhibitor-ZK-服务" class="headerlink" title="使用DC/OS的Exhibitor(ZK)服务"></a>使用DC/OS的Exhibitor(ZK)服务</h3><p>在使用DC/OS默认的Exhibitor(ZK)集群服务时，<code>mesos.master.url</code>通常配置为：<code>zk://mesos.master:2181/mesos</code>。<code>storm.zookeeper.servers</code>配置为：<code>mesos.master</code>。即：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">mesos.master.url: zk://mesos.master:2181/mesos</div><div class="line">storm.zookeeper.servers:</div><div class="line">- &quot;mesos.master&quot;</div></pre></td></tr></table></figure>
<p>Storm集群的配置信息默认存储在ZK的<code>/storm</code>节点下。</p>
<p>Storm集群默认配置数据目录存放在“<code>storm-local</code>”下，相对于<code>/opt/storm</code>路径。可以通过容器卷挂载将数据存放到持久化卷或外部存储，如NFS。</p>
<p>可以通过容器卷挂载，将<code>/opt/storm/conf</code>和<code>/opt/storm/log4j2</code>挂载到外部存储，让Storm集群能够读取外部配置。</p>
<p>当前在DC/OS中，Nimbus服务部署的网络采用<strong>HOST</strong>模式。</p>
<p><strong>注意</strong>，当前实现无法读取<code>nimbus.seeds</code>中的配置，只支持<code>nimbus.host</code>。因此，必须在<code>storm.yaml</code>（可以通过挂载）中指定Nimbus服务的节点IP地址或主机名。这与DC/OS中服务的动态性相冲突，目前的解决方案是通过Marathon部署时<a href="/dcos-marathon-constraints.md">限定</a>Nimbus的部署节点，并预先在<code>storm.yaml</code>中指定所部署的目标Agent节点的IP或主机名。</p>
<p><strong>注意</strong>，脚本run-with-marathon.sh默认同时启动UI服务，可以通过<strong>STORM_UI_OPTS</strong>环境变量进行特定设置。</p>
<p>此种方式的Marathon应用JSON定义如下：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div></pre></td><td class="code"><pre><div class="line">&#123;</div><div class="line">    <span class="attr">"id"</span>: <span class="string">"/storm-nimbus"</span>,</div><div class="line">    <span class="attr">"cmd"</span>: <span class="string">"./bin/run-with-marathon.sh"</span>,</div><div class="line">    <span class="attr">"env"</span>: &#123;</div><div class="line">        <span class="attr">"HOSTNAME"</span>: <span class="string">"192.168.1.80"</span>,</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">"instances"</span>: <span class="number">1</span>,</div><div class="line">    <span class="attr">"cpus"</span>: <span class="number">1</span>,</div><div class="line">    <span class="attr">"mem"</span>: <span class="number">1024</span>,</div><div class="line">    <span class="attr">"constraints"</span>: [</div><div class="line">        [</div><div class="line">            <span class="string">"hostname"</span>,</div><div class="line">            <span class="string">"LIKE"</span>,</div><div class="line">            <span class="string">"192.168.1.80"</span></div><div class="line">        ]</div><div class="line">    ],</div><div class="line">    <span class="attr">"container"</span>: &#123;</div><div class="line">        <span class="attr">"docker"</span>: &#123;</div><div class="line">            <span class="attr">"image"</span>: <span class="string">"192.168.0.1/daas/storm:0.2.1-SNAPSHOT-1.0.2-1.1.0-jdk8"</span>,</div><div class="line">            <span class="attr">"forcePullImage"</span>: <span class="literal">true</span>,</div><div class="line">            <span class="attr">"privileged"</span>: <span class="literal">false</span>,</div><div class="line">            <span class="attr">"network"</span>: <span class="string">"HOST"</span></div><div class="line">        &#125;,</div><div class="line">        <span class="attr">"type"</span>: <span class="string">"DOCKER"</span>,</div><div class="line">        <span class="attr">"volumes"</span>: [</div><div class="line">            &#123;</div><div class="line">                <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/conf"</span>,</div><div class="line">                <span class="attr">"hostPath"</span>: <span class="string">"/data/storm/conf"</span>,</div><div class="line">                <span class="attr">"mode"</span>: <span class="string">"RW"</span></div><div class="line">            &#125;,</div><div class="line">            &#123;</div><div class="line">                <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/log4j2"</span>,</div><div class="line">                <span class="attr">"hostPath"</span>: <span class="string">"/data/storm/log4j2"</span>,</div><div class="line">                <span class="attr">"mode"</span>: <span class="string">"RW"</span></div><div class="line">            &#125;,</div><div class="line">            &#123;</div><div class="line">                <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/storm-local"</span>,</div><div class="line">                <span class="attr">"hostPath"</span>: <span class="string">"/data/storm/data"</span>,</div><div class="line">                <span class="attr">"mode"</span>: <span class="string">"RW"</span></div><div class="line">            &#125;</div><div class="line">        ]</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">"healthChecks"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"HTTP"</span>,</div><div class="line">            <span class="attr">"path"</span>: <span class="string">"/"</span>,</div><div class="line">            <span class="attr">"gracePeriodSeconds"</span>: <span class="number">120</span>,</div><div class="line">            <span class="attr">"intervalSeconds"</span>: <span class="number">20</span>,</div><div class="line">            <span class="attr">"timeoutSeconds"</span>: <span class="number">20</span>,</div><div class="line">            <span class="attr">"maxConsecutiveFailures"</span>: <span class="number">3</span>,</div><div class="line">            <span class="attr">"ignoreHttp1xx"</span>: <span class="literal">false</span></div><div class="line">        &#125;</div><div class="line">    ],</div><div class="line">    <span class="attr">"portDefinitions"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">6626</span></div><div class="line">        &#125;,</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">6627</span></div><div class="line">        &#125;</div><div class="line">    ],</div><div class="line">    <span class="attr">"requirePorts"</span>: <span class="literal">true</span></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="使用独立的Exhibitor-ZK-服务"><a href="#使用独立的Exhibitor-ZK-服务" class="headerlink" title="使用独立的Exhibitor(ZK)服务"></a>使用独立的Exhibitor(ZK)服务</h3><p>使用不同于DC/OS默认Exhibitor(ZK)集群时，可以通过<strong>STORM_NIMBUS_OPTS</strong>环境变量直接指定ZK集群的IP或主机名列表。其它需要注意的地方与上述配置相同。</p>
<p>此种方式的Marathon应用JSON定义如下：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div></pre></td><td class="code"><pre><div class="line">&#123;</div><div class="line">    <span class="attr">"id"</span>: <span class="string">"/storm-nimbus-dev"</span>,</div><div class="line">    <span class="attr">"cmd"</span>: <span class="string">"./bin/run-with-marathon.sh"</span>,</div><div class="line">    <span class="attr">"env"</span>: &#123;</div><div class="line">        <span class="attr">"HOSTNAME"</span>: <span class="string">"192.168.1.89"</span>,</div><div class="line">        <span class="attr">"STORM_NIMBUS_OPTS"</span>: <span class="string">"-c storm.zookeeper.servers=[\"192.168.1.70\",\"192.168.1.73\",\"192.168.1.88\"]"</span></div><div class="line">    &#125;,</div><div class="line">    <span class="attr">"instances"</span>: <span class="number">1</span>,</div><div class="line">    <span class="attr">"cpus"</span>: <span class="number">1</span>,</div><div class="line">    <span class="attr">"mem"</span>: <span class="number">1024</span>,</div><div class="line">    <span class="attr">"constraints"</span>: [</div><div class="line">        [</div><div class="line">            <span class="string">"hostname"</span>,</div><div class="line">            <span class="string">"LIKE"</span>,</div><div class="line">            <span class="string">"192.168.1.89"</span></div><div class="line">        ]</div><div class="line">    ],</div><div class="line">    <span class="attr">"container"</span>: &#123;</div><div class="line">        <span class="attr">"docker"</span>: &#123;</div><div class="line">            <span class="attr">"image"</span>: <span class="string">"192.168.0.1/daas/storm:0.2.1-SNAPSHOT-1.0.2-1.1.0-jdk8"</span>,</div><div class="line">            <span class="attr">"forcePullImage"</span>: <span class="literal">true</span>,</div><div class="line">            <span class="attr">"privileged"</span>: <span class="literal">false</span>,</div><div class="line">            <span class="attr">"network"</span>: <span class="string">"HOST"</span></div><div class="line">        &#125;,</div><div class="line">    <span class="attr">"type"</span>: <span class="string">"DOCKER"</span>,</div><div class="line">    <span class="attr">"volumes"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/conf"</span>,</div><div class="line">            <span class="attr">"hostPath"</span>: <span class="string">"/data/storm-dev/conf"</span>,</div><div class="line">            <span class="attr">"mode"</span>: <span class="string">"RW"</span></div><div class="line">        &#125;,</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/log4j2"</span>,</div><div class="line">            <span class="attr">"hostPath"</span>: <span class="string">"/data/storm-dev/log4j2"</span>,</div><div class="line">            <span class="attr">"mode"</span>: <span class="string">"RW"</span></div><div class="line">        &#125;,</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/storm-local"</span>,</div><div class="line">            <span class="attr">"hostPath"</span>: <span class="string">"/data/storm-dev/data"</span>,</div><div class="line">            <span class="attr">"mode"</span>: <span class="string">"RW"</span></div><div class="line">        &#125;</div><div class="line">    ]</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">"healthChecks"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"HTTP"</span>,</div><div class="line">            <span class="attr">"path"</span>: <span class="string">"/"</span>,</div><div class="line">            <span class="attr">"gracePeriodSeconds"</span>: <span class="number">120</span>,</div><div class="line">            <span class="attr">"intervalSeconds"</span>: <span class="number">20</span>,</div><div class="line">            <span class="attr">"timeoutSeconds"</span>: <span class="number">20</span>,</div><div class="line">            <span class="attr">"maxConsecutiveFailures"</span>: <span class="number">3</span>,</div><div class="line">            <span class="attr">"ignoreHttp1xx"</span>: <span class="literal">false</span></div><div class="line">        &#125;</div><div class="line">    ],</div><div class="line">    <span class="attr">"portDefinitions"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">16626</span></div><div class="line">        &#125;,</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">16627</span></div><div class="line">        &#125;</div><div class="line">    ],</div><div class="line">    <span class="attr">"requirePorts"</span>: <span class="literal">true</span></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>将上述JSON定义保存为<code>storm-dcos-nimbus.json</code>，通过CLI部署服务：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">dcos marathon app add storm-dcos-nimbus.json</div></pre></td></tr></table></figure>
<p>也可以将JSON定义粘贴到WEB UI部署服务的弹出框里，进行必要的修改后直接部署。</p>
<h2 id="DRPC部署"><a href="#DRPC部署" class="headerlink" title="DRPC部署"></a>DRPC部署</h2><p>DRPC服务在DC/OS中部署时，网络采用HOST模式。</p>
<p>DRPC服务节点在<code>storm.yaml</code>中是通过<code>drpc.servers</code>静态配置的，这也与服务在DC/OS中的动态特性相冲突。</p>
<p>解决方案类似于Nimbus服务，根据需要的DRPC服务器节点数，预先选定一部分Agent节点IP地址，这些地址是一个Agent节点IP列表的子集。在部署DRPC服务时，通过约束将服务限定在隶属于这个子集的Agent节点上。</p>
<p>例如，假定当前DC/OS集群中存在<code>1.80，1.81，1.82，1.83</code>四个私有Agent，在<code>storm.yaml</code>中按如下配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">drpc.servers:</div><div class="line">- &quot;192.168.1.80&quot;</div><div class="line">- &quot;192.168.1.81&quot;</div><div class="line">- &quot;192.168.1.82&quot;</div><div class="line">- &quot;192.168.1.83&quot;</div></pre></td></tr></table></figure>
<p>在DRPC服务的Marathon定义中使用约束<code>hostname:LIKE:192.168.1.8[0,1,2,3]</code>。</p>
<p>DRPC服务的Marathon应用JSON定义如下：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div></pre></td><td class="code"><pre><div class="line">&#123;</div><div class="line">    <span class="attr">"id"</span>: <span class="string">"/storm-drpc-dev"</span>,</div><div class="line">    <span class="attr">"cmd"</span>: <span class="string">"bin/storm drpc -c storm.log.dir=$MESOS_SANDBOX/logs"</span>,</div><div class="line">    <span class="attr">"instances"</span>: <span class="number">4</span>,</div><div class="line">    <span class="attr">"cpus"</span>: <span class="number">0.5</span>,</div><div class="line">    <span class="attr">"mem"</span>: <span class="number">2048</span>,</div><div class="line">    <span class="attr">"constraints"</span>: [</div><div class="line">        [</div><div class="line">            <span class="string">"hostname"</span>,</div><div class="line">            <span class="string">"LIKE"</span>,</div><div class="line">            <span class="string">"192.168.1.8[0-9]"</span></div><div class="line">        ]</div><div class="line">    ],</div><div class="line">    <span class="attr">"container"</span>: &#123;</div><div class="line">        <span class="attr">"docker"</span>: &#123;</div><div class="line">            <span class="attr">"image"</span>: <span class="string">"192.168.0.1/daas/storm:0.2.1-SNAPSHOT-1.0.2-1.1.0-jdk8"</span>,</div><div class="line">            <span class="attr">"forcePullImage"</span>: <span class="literal">true</span>,</div><div class="line">            <span class="attr">"privileged"</span>: <span class="literal">false</span>,</div><div class="line">            <span class="attr">"network"</span>: <span class="string">"HOST"</span></div><div class="line">        &#125;,</div><div class="line">        <span class="attr">"type"</span>: <span class="string">"DOCKER"</span>,</div><div class="line">        <span class="attr">"volumes"</span>: [</div><div class="line">            &#123;</div><div class="line">                <span class="attr">"containerPath"</span>: <span class="string">"/opt/storm/conf"</span>,</div><div class="line">                <span class="attr">"hostPath"</span>: <span class="string">"/data/storm-dev/conf"</span>,</div><div class="line">                <span class="attr">"mode"</span>: <span class="string">"RO"</span></div><div class="line">            &#125;</div><div class="line">        ]</div><div class="line">    &#125;,</div><div class="line">    <span class="attr">"healthChecks"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"TCP"</span>,</div><div class="line">            <span class="attr">"gracePeriodSeconds"</span>: <span class="number">30</span>,</div><div class="line">            <span class="attr">"intervalSeconds"</span>: <span class="number">30</span>,</div><div class="line">            <span class="attr">"timeoutSeconds"</span>: <span class="number">60</span>,</div><div class="line">            <span class="attr">"maxConsecutiveFailures"</span>: <span class="number">3</span></div><div class="line">        &#125;</div><div class="line">    ],</div><div class="line">    <span class="attr">"portDefinitions"</span>: [</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">3772</span>,</div><div class="line">            <span class="attr">"labels"</span>: &#123;</div><div class="line">                <span class="attr">"VIP_0"</span>: <span class="string">"/storm-drpc-dev:3772"</span></div><div class="line">            &#125;</div><div class="line">        &#125;,</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">3773</span></div><div class="line">        &#125;,</div><div class="line">        &#123;</div><div class="line">            <span class="attr">"protocol"</span>: <span class="string">"tcp"</span>,</div><div class="line">            <span class="attr">"port"</span>: <span class="number">3774</span></div><div class="line">        &#125;</div><div class="line">    ],</div><div class="line">    <span class="attr">"requirePorts"</span>: <span class="literal">true</span></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p><strong>注意</strong>，DRPC的应用定义中，为端口<strong>3772</strong>配置了VIPs，集群中部署的其他服务通过<code>storm-drpc-dev.marathon.l4lb.thisdcos.directory:3772</code>调用DRPC服务时，DC/OS自动为DRPC实现了负载均衡。</p>
<p>DRPC服务的部署命令参考Nimbus服务的部署。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/docker/" rel="tag"># docker</a>
          
            <a href="/tags/zookeeper/" rel="tag"># zookeeper</a>
          
            <a href="/tags/storm/" rel="tag"># storm</a>
          
            <a href="/tags/mesos/" rel="tag"># mesos</a>
          
            <a href="/tags/dcos/" rel="tag"># dcos</a>
          
            <a href="/tags/marathon/" rel="tag"># marathon</a>
          
            <a href="/tags/drpc/" rel="tag"># drpc</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/12/03/storm-on-dcos-2/" rel="next" title="Storm on DC/OS(2) - 集群配置">
                <i class="fa fa-chevron-left"></i> Storm on DC/OS(2) - 集群配置
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/12/07/storm-on-dcos-4/" rel="prev" title="Storm on DC/OS(4) - 访问集群">
                Storm on DC/OS(4) - 访问集群 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2016/12/05/storm-on-dcos-3/"
     data-title="Storm on DC/OS(3) - 集群部署"
     data-content=""
     data-url="http://chrisrc.me/2016/12/05/storm-on-dcos-3/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2016/12/05/storm-on-dcos-3/"
           data-title="Storm on DC/OS(3) - 集群部署" data-url="http://chrisrc.me/2016/12/05/storm-on-dcos-3/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="chrisrc" />
          <p class="site-author-name" itemprop="name">chrisrc</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">69</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">162</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/christtrc" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/chrisrc" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Nimbus部署"><span class="nav-number">1.</span> <span class="nav-text">Nimbus部署</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#使用DC-OS的Exhibitor-ZK-服务"><span class="nav-number">1.1.</span> <span class="nav-text">使用DC/OS的Exhibitor(ZK)服务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#使用独立的Exhibitor-ZK-服务"><span class="nav-number">1.2.</span> <span class="nav-text">使用独立的Exhibitor(ZK)服务</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#DRPC部署"><span class="nav-number">2.</span> <span class="nav-text">DRPC部署</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">
     
      <a href="mailto:chrisrc@qq.com">chrisrc</a> 
    
  </span>
  <span class="author"> &nbsp; QQ: 58122705 </span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"chrisrc"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  








  
  

  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
<script>
(function(){
   var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04":"https://jspassport.ssl.qhimg.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04";
   document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>

  


</body>
</html>
